package com.design.pattern.chainOfResponsibility;

public class FactoryHandler {

    public static GateWayHandler getFirstGatewayHandler() {
        // 1.创建所以关卡对象,第一关c,第二关d,第三关e
        CHandler c = new CHandler();
        DHandler d = new DHandler();
        EHandler e = new EHandler();
        // 2.为每一关指定下一关 c的下一关为d d的下一关为e
        c.setNextGateWayHandler(d);
        d.setNextGateWayHandler(e);
        return c;
    }

}
